<template>
    <div class="cash">
        <el-dialog width="60%" title="提现记录" :visible.sync="isShow" class="dialog_box" :before-close="handleCancel" :close-on-click-modal="false">
            <el-table
                :data="tableData"
                style="width: 100%"
                v-loading="loading">
                <el-table-column
                    prop="create_time"
                    label="时间"
                    width="180">
                </el-table-column>
                <el-table-column
                    label="姓名"
                    width="180">
                    <template>
                        <p>{{name}}</p>
                    </template>
                </el-table-column>
                <el-table-column
                    label="手机号"
                    width="180">
                    <template>
                        <p>{{phone}}</p>
                    </template>
                </el-table-column>
                <el-table-column
                    prop="amount"
                    label="金额">
                </el-table-column>
                <el-table-column
                    prop="remark"
                    label="备注">
                </el-table-column>
            </el-table>
        </el-dialog>
    </div>
</template>

<script>
import * as api from '@/api/api';
export default {
    props: ['userData','isShow'],
    data() {
        return{
            tableData: [],
            name: '',
            phone: '',
            loading: true,
        }
    },

    //计算属性
    computed: {

    },

    //钩子函数（页面挂载完成时触发）
    mounted() {
        this.getData()
    },

    //自定义方法
    methods: {
        getData() {
            let body = {
                uid: this.userData.uid,
                role_manage_id: this.userData.id
            }
            this.loading = true;
            this.name = this.userData.user_info.name;
            this.phone = this.userData.user_info.account;
            api.getCashList(body).then(res => {
                this.loading = false;
                if(res.data.code === 200) {
                    this.tableData = res.data.data.data;
                }
            })
        },

        handleCancel() {
            this.$emit('close')
        }
    },
}
</script>

<style lang="less">
    .cash{
        
    }
</style>
